package com.tancire.system.service.impl;

import java.util.List;
import javax.annotation.Resource;
import com.tancire.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.tancire.system.mapper.SysTodayAmountMapper;
import com.tancire.system.domain.SysTodayAmount;
import com.tancire.system.service.ISysTodayAmountService;

/**
 * 广告收入Service业务层处理
 *
 * @author chenchao
 * @date 2023-12-31
 */
@Service
public class SysTodayAmountServiceImpl implements ISysTodayAmountService {
    @Resource
    private SysTodayAmountMapper sysTodayAmountMapper;

    /**
     * 查询广告收入
     *
     * @param id 广告收入主键
     * @return 广告收入
     */
    @Override
    public SysTodayAmount selectSysTodayAmountById(Long id) {
        return sysTodayAmountMapper.selectSysTodayAmountById(id);
    }

    /**
     * 查询广告收入列表
     *
     * @param sysTodayAmount 广告收入
     * @return 广告收入
     */
    @Override
    public List<SysTodayAmount> selectSysTodayAmountList(SysTodayAmount sysTodayAmount) {
        return sysTodayAmountMapper.selectSysTodayAmountList(sysTodayAmount);
    }

    /**
     * 新增广告收入
     *
     * @param sysTodayAmount 广告收入
     * @return 结果
     */
    @Override
    public int insertSysTodayAmount(SysTodayAmount sysTodayAmount) {
        sysTodayAmount.setCreateTime(DateUtils.getNowDate());
        return sysTodayAmountMapper.insertSysTodayAmount(sysTodayAmount);
    }

    /**
     * 修改广告收入
     *
     * @param sysTodayAmount 广告收入
     * @return 结果
     */
    @Override
    public int updateSysTodayAmount(SysTodayAmount sysTodayAmount) {
        sysTodayAmount.setUpdateTime(DateUtils.getNowDate());
        return sysTodayAmountMapper.updateSysTodayAmount(sysTodayAmount);
    }

    /**
     * 批量删除广告收入
     *
     * @param ids 需要删除的广告收入主键
     * @return 结果
     */
    @Override
    public int deleteSysTodayAmountByIds(Long[] ids) {
        return sysTodayAmountMapper.deleteSysTodayAmountByIds(ids);
    }

    /**
     * 删除广告收入信息
     *
     * @param id 广告收入主键
     * @return 结果
     */
    @Override
    public int deleteSysTodayAmountById(Long id) {
        return sysTodayAmountMapper.deleteSysTodayAmountById(id);
    }
}
